﻿using Compass.Wasm.Shared.Categories;
using Compass.Wasm.Shared;
using System.Collections.Generic;

namespace Compass.Wpf.ApiServices.Categories;
public interface IProductService:IBaseService<ProductDto>
{
    //获取产品模型树
    Task<ApiResponse<List<ProductDto>>> GetModelTypeTreeAsync();
}
public class ProductService:BaseService<ProductDto>,IProductService
{
    private readonly HttpRestClient _client;
    private const string ServiceName = "Product";
    public ProductService(HttpRestClient client) : base(client, ServiceName)
    {
        _client = client;
    }

    public async Task<ApiResponse<List<ProductDto>>> GetModelTypeTreeAsync()
    {
        var request = new BaseRequest
        {
            Method = RestSharp.Method.Get,
            Route = $"api/{ServiceName}/ModelTypeTree"
        };
        return await _client.ExecuteAsync<List<ProductDto>>(request);
    }

   
}